package cn.iocoder.yudao.module.product.dal.mysql.calculationmodel;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.product.dal.dataobject.calculationmodel.CalculationModelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.product.controller.admin.calculationmodel.vo.*;

/**
 * 核算模型 Mapper
 *
 * @author wcl
 */
@Mapper
public interface CalculationModelMapper extends BaseMapperX<CalculationModelDO> {

    default PageResult<CalculationModelDO> selectPage(CalculationModelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CalculationModelDO>()
                .likeIfPresent(CalculationModelDO::getName, reqVO.getName())
                .eqIfPresent(CalculationModelDO::getProductId, reqVO.getProductId())
                .betweenIfPresent(CalculationModelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CalculationModelDO::getId));
    }

}
